home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODF-Interest Archive / June 96 / Re BUG Rendering Icons < prev    next >
Encoding:
Internet Message Format  |  1996-12-03  |  2.8 KB  |  [TEXT/ttxt]

  1. Subject:     Re: BUG: Rendering Icons
  2. Sent:        6/26/96 2:27 PM
  3. Received:    6/26/96 2:41 PM
  4. From:        Henri Lamiraux, lamiraux@apple.com
  5. Reply-To:    ODF Interest, ODF-Interest@CILabs.ORG
  6. To:          OpenDoc Development Framework Discussion List, ODF-Interest@CILabs.
  7.  
  8. Looks like a bug. I logged your feedback and it should be fixed in the 
  9. next release of ODF.
  10.  
  11. Thanks
  12.  
  13.  
  14. >I think it is a bug that FW_CIconShape::RenderIcon does not always honor 
  15. >the rect it is given for drawing.
  16. >
  17. >I start with a handle to an IconSuite, which I get by asking a Cyberdog 
  18. >CyberItem. In other words, I can't supply a file and resourceID, I must 
  19. >start with a handle to an icon suite. Then I make a FW_CIcon from that.
  20. >
  21. >The problem is that when you give the FW_CIcon constructor a handle to an 
  22. >icon suite, it computes the size of the icon by going through all the 
  23. >icons in the suite and finding the BIGGEST size icon in the suite. Thus, 
  24. >if you have a suite with both 16x16 and 32x32 icons, it is considered a 
  25. >32x32 icon.
  26. >
  27. >This is different from making an FW_CIcon by supplying a resource file 
  28. >and ID to the constructor, because in that method, you can specify a size 
  29. >parameter which explicitly tells it which size icon you are interested in.
  30. >
  31. >Now, when I use RenderIcon in this FW_CIcon, it uses the size of the 
  32. >FW_CIcon to determine the size of the icon it will draw. I am supplying 
  33. >the method with a 16x16 rect to draw in, but this is overridden, as it 
  34. >thinks the icon itself is 32x32 and it draws a 32x32 icon with its 
  35. >topleft in the right place, but it blasts a 32x32 icon on the canvas.
  36. >
  37. >Peeping at the sources, I believe there are several places you might fix 
  38. >this. I would like to suggest adding an optional size parameter to the 
  39. >FW_CIcon constructor which accepts a FW_PlatformIcon. This breaks 
  40. >nothing, and could save a little memory by not loading unnecessary icons. 
  41. >IT doesn't solve the whole problem though. To do that, the Rendering of 
  42. >an icon should honor the size of the rect supplied it. If a 16x16 rect is 
  43. >given, it should draw a 16x16 icon. No way should it draw anything 
  44. >outside the rect, as it does now.
  45. >
  46. >By the way, I worked around this bug by going through the suite, removing 
  47. >any 32x32 icons within it, and then passing it to the FW_CIcon 
  48. >constructor. This was the only way I could draw a 16x16 icon from a suite 
  49. >which might contain 32x32 versions. It is not a perfect workaround 
  50. >because I am assuming the suite I'm given has at least one 16x16 icon in 
  51. >it.
  52. >
  53. >-Mike
  54.  
  55.  
  56. ........................................................................
  57.  Henri Lamiraux                                      lamiraux@apple.com
  58.  Apple Computer, Inc.                 OpenDoc(tm) Development Framework
  59. ........................................................................
  60.  
  61.